import { createVNode } from 'vue'
import { Modal } from 'ant-design-vue'

export default function ({ title = '提示', content = '确认提交？', okText = '确定', cancelText = '取消' }) {
  return new Promise((resolve) => {
    Modal.confirm({
      title,
      okText,
      centered: true,
      width: 560,
      cancelText,
      zIndex: 99999,
      content: createVNode('div', { style: 'margin:24px 0;font-size:15px' }, content),
      onOk: () => resolve(true),
      onCancel: () => resolve(false)
    })
  })
}
